<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2021/7/24
  Time: 13:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>展示</title>
</head>
<body>
    <h1 align="center">您好${sessionScope.login}</h1>
    <h5 align="center"><a href="${pageContext.request.contextPath}/person/add.jsp">添加</a></h5>
    <hr/>
<%--    表单套表格用于批量删除--%>
    <form action="${pageContext.request.contextPath}/person/removeP.do">
<%--        设计表格居中 边框为1--%>
        <table align="center" border="1">
<%--            表头开始--%>
            <thead>
                <tr>
                    <td><input type="submit" value="批量删除"></td>
                    <td>person_id</td>
                    <td>person_name</td>
                    <td>age</td>
                    <td>sex</td>
                    <td>mobile</td>
                    <td>address</td>
                    <td colspan='2' align="center">操作</td>
                </tr>
            </thead>
            <tbody>
                <c:forEach var="p" items="${requestScope.people}">
                    <tr>
                            <%--批量删除的复选框--%>
                        <td> <input type="checkbox" name="ids" value="${p.psId}"/></td>
                        <td>${p.psId}</td>
                        <td>${p.psName}</td>
                        <td>${p.age}</td>
                        <td>${p.sex}</td>
                        <td>${p.mobile}</td>
                        <td>${p.address}</td>
                        <td><a href="${pageContext.request.contextPath}/person/update.do?id=${p.psId}">更新</a></td>
                        <td><a href="${pageContext.request.contextPath}/person/remove.do?id=${p.psId}">删除</a></td>
                    </tr>
                </c:forEach>
            </tbody>
        </table>
    </form>
</body>
</html>
